package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
 * @Author: hx
 * @CreateTime: 2021/10/8 13:26
 * @Description: 公共的返回对象
 * */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespBean {
    private long code;
    private String message;
    private Object obj;


    /**
     * @param message
     * @Description: 成功返回结果
     * @return:
     * @Author: Hx
     * @Date: 2021/10/8
    */
    public static RespBean success(String message){
        return new RespBean(200,message,null);
    }
    /**
     * @param message
     * @param obj
     * @Description: 成功返回结果
     * @Author: Hx
     * @Date: 2021/10/8
    */
    public static RespBean success(String message,Object obj){
        return new RespBean(200,message,obj);
    }
    /**
     * 失败返回结果
     * @param message
     * @return
     */
    public static RespBean error(String message){
        return new RespBean(500,message,null);
    }

    /**
     * 失败返回结果
     * @param message
     * @param obj
     * @return
     */
    public static RespBean error(String message,Object obj){
        return new RespBean(500,message,obj);
    }

}
